<!-- 页面：App官网首页 | 时间：2025-09-28 -->
<template>
  <PageContainer class="home" :showNavBar="false">
    <!-- 顶部导航 -->
    <view class="header">
      <view class="nav-container">
        <view class="logo-section">
          <up-image
            src="/static/images/logo.png"
            mode="widthFix"
            class="logo-image"
            width="40"
          ></up-image>
          <text class="logo">KK 钱包</text>
        </view>
      </view>
    </view>

    <!-- Hero Banner -->
    <view class="hero-banner">
      <view class="hero-content">
        <view class="hero-text">
          <text class="hero-title animate-fade-in-up"
            >智能支付，让生活更简单</text
          >
          <text class="hero-subtitle animate-fade-in-up animate-delay-1"
            >安全便捷的移动支付解决方案，支持多种支付方式，让每一笔交易都安心可靠</text
          >
          <view class="hero-buttons animate-fade-in-up animate-delay-2">
            <up-button
              type="primary"
              shape="circle"
              class="download-btn primary pulse-animation"
              text="立即下载"
              icon="download"
              @click="goDownload"
            >
            </up-button>
            <up-button
              type="info"
              shape="circle"
              plain
              class="learn-btn"
              @click="learnMore"
              text="了解更多"
            >
            </up-button>
          </view>
        </view>
        <!-- <view class="hero-image">
          <up-icon name="mobile" size="120" color="#1677ff"></up-icon>
        </view> -->
      </view>
    </view>

    <!-- 功能特色 -->
    <view class="features-section">
      <view class="section-header animate-fade-in-up">
        <text class="section-title">核心功能</text>
        <text class="section-subtitle">为您提供全方位的支付解决方案</text>
      </view>
      <view class="features-grid">
        <view
          class="feature-card animate-scale-in"
          :class="'animate-delay-' + (index % 6)"
          v-for="(item, index) in features"
          :key="index"
        >
          <view class="feature-icon">
            <up-icon
              custom-prefix="iconfont"
              :name="item.icon"
              size="40"
              :color="item.color"
            ></up-icon>
          </view>
          <text class="feature-title">{{ item.title }}</text>
          <text class="feature-desc">{{ item.desc }}</text>
        </view>
      </view>
    </view>

    <!-- 应用截图 -->
    <view class="screenshots-section" id="screenshots">
      <view class="section-header animate-fade-in-up">
        <text class="section-title">应用预览</text>
        <text class="section-subtitle">简洁直观的用户界面设计</text>
      </view>
      <view class="screenshots-container">
        <view
          class="screenshot-item animate-zoom-in"
          :class="'animate-delay-' + index"
          v-for="(item, index) in screenshots"
          :key="index"
        >
          <view class="phone-mockup">
            <up-image :src="item.url" width="100%" mode="widthFix"></up-image>
            <text class="screenshot-label">{{ item.label }}</text>
          </view>
        </view>
      </view>
    </view>

    <!-- 下载区域 -->
    <view class="download-section">
      <view class="download-content">
        <text class="download-title animate-fade-in-up">立即下载体验</text>
        <text class="download-subtitle animate-fade-in-up animate-delay-1"
          >支持 iOS 和 Android 平台</text
        >
        <view class="download-buttons animate-fade-in-up animate-delay-2">
          <view class="download-item" @click="downloadIOS">
            <u-icon name="apple-fill" size="24" color="#ffffff"></u-icon>
            <view class="download-text">
              <text class="download-platform">App Store</text>
              <text class="download-desc">iOS 版本</text>
            </view>
          </view>
          <view class="download-item" @click="downloadAndroid">
            <u-icon name="android-fill" size="24" color="#ffffff"></u-icon>
            <view class="download-text">
              <text class="download-platform">Google Play</text>
              <text class="download-desc">Android 版本</text>
            </view>
          </view>
        </view>
      </view>
    </view>

    <!-- 底部信息 -->
    <view class="footer">
      <view class="footer-content">
        <view class="footer-info">
          <text class="footer-title">KK 钱包</text>
          <text class="footer-desc">专业的移动支付解决方案</text>
        </view>
        <!-- <view class="footer-links">
          <text class="footer-link" @click="goAbout">关于我们</text>
          <text class="footer-link" @click="goPrivacy">隐私政策</text>
          <text class="footer-link" @click="goTerms">使用条款</text>
        </view> -->
        <text class="copyright">© 2025 KK 钱包 版权所有</text>
      </view>
    </view>
  </PageContainer>
</template>

<script setup lang="ts">
import { ref } from "vue";
import PageContainer from "@/components/common/PageContainer.vue";

// 功能特色数据
const features = ref([
  {
    icon: "anquan-icon",
    title: "安全可靠",
    desc: "银行级加密技术，保障资金安全",
    color: "#1677ff",
  },
  {
    icon: "scan-icon",
    title: "快速支付",
    desc: "扫码即付，一秒完成交易",
    color: "#52c41a",
  },
  {
    icon: "qianbao-icon",
    title: "多币种支持",
    desc: "支持多种数字货币和法币",
    color: "#fa8c16",
  },
  {
    icon: "chat-icon",
    title: "24小时客服",
    desc: "专业客服团队随时为您服务",
    color: "#722ed1",
  },
  {
    icon: "zichanxinxi-icon",
    title: "低手续费",
    desc: "行业最低手续费率，节省成本",
    color: "#eb2f96",
  },
  {
    icon: "globe-icon",
    title: "全球通用",
    desc: "支持全球200+国家和地区",
    color: "#13c2c2",
  },
]);

// 应用截图数据
const screenshots = ref([
  { url: "/static/images/p1.png", label: "首页" },
  { url: "/static/images/p2.png", label: "交易" },
  { url: "/static/images/p3.png", label: "钱包" },
  { url: "/static/images/p4.png", label: "转账" },
]);

// 跳转下载页面
const goDownload = () => {
  uni.showToast({
    title: "功能开发中",
    icon: "success",
  });
  // 可替换为实际下载链接
  // setTimeout(() => {
  //   uni.navigateTo({
  //     url: "/pages/payDetail/payDetail",
  //   });
  // }, 1000);
};

// 了解更多
const learnMore = () => {
  uni.pageScrollTo({
    selector: "#screenshots",
    duration: 500,
  });
};

// iOS下载
const downloadIOS = () => {
  uni.showToast({
    title: "即将跳转App Store",
    icon: "success",
  });
};

// Android下载
const downloadAndroid = () => {
  uni.showToast({
    title: "即将跳转Google Play",
    icon: "success",
  });
};

// 关于我们
const goAbout = () => {
  uni.showToast({
    title: "关于我们",
    icon: "none",
  });
};

// 隐私政策
const goPrivacy = () => {
  uni.showToast({
    title: "隐私政策",
    icon: "none",
  });
};

// 使用条款
const goTerms = () => {
  uni.showToast({
    title: "使用条款",
    icon: "none",
  });
};
</script>

<style lang="scss" scoped>
.home {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: #ffffff;
  color: #333;

  // 顶部导航
  .header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: #004fcc;
    box-shadow: 0 2rpx 20rpx rgba(0, 79, 204, 0.3);

    .nav-container {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 20rpx 40rpx;
      max-width: 100%;
      margin: 0 auto;

      .logo-section {
        display: flex;
        align-items: center;
        gap: 12rpx;

        .logo {
          font-size: 32rpx;
          font-weight: bold;
          color: #ffffff;
          letter-spacing: 1rpx;
        }
      }

      .header-download-btn {
        background: rgba(255, 255, 255, 0.2);
        border: 1rpx solid rgba(255, 255, 255, 0.3);
        color: #ffffff;
      }
    }
  }

  // Hero Banner
  .hero-banner {
    padding-top: 120rpx;
    background: linear-gradient(135deg, #1677ff 0%, #40a9ff 100%);
    background-size: cover;
    color: #ffffff;
    overflow: hidden;
    position: relative;

    &::before {
      content: "";
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 100" fill="rgba(255,255,255,0.05)"><circle cx="200" cy="50" r="50"/><circle cx="800" cy="30" r="30"/><circle cx="600" cy="80" r="40"/></svg>');
      animation: float 20s ease-in-out infinite;
    }

    .hero-content {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 80rpx 40rpx;
      margin: 0 auto;
      position: relative;
      max-width: 1200rpx;
      z-index: 1;

      .hero-text {
        flex: 1;
        text-align: center;

        .hero-title {
          font-size: 48rpx;
          font-weight: bold;
          line-height: 1.3;
          margin-bottom: 24rpx;
          display: block;
        }

        .hero-subtitle {
          font-size: 28rpx;
          line-height: 1.6;
          opacity: 0.9;
          margin-bottom: 48rpx;
          display: block;
        }

        .hero-buttons {
          display: flex;
          gap: 24rpx;
          justify-content: center;
          align-items: center;

          .download-btn {
            background: #ffffff;
            color: #fff;
            box-shadow: 0 8rpx 24rpx rgba(0, 0, 0, 0.15);
            transform: translateY(0);
            transition: all 0.3s ease;

            &:hover {
              transform: translateY(-4rpx);
              box-shadow: 0 12rpx 32rpx rgba(0, 0, 0, 0.2);
            }
          }

          .learn-btn {
            border-color: rgba(255, 255, 255, 0.5);
            color: #ffffff;
          }
        }
      }

      .hero-image {
        flex-shrink: 0;
        margin-left: 40rpx;
        opacity: 0.3;
      }
    }
  }

  // 功能特色
  .features-section {
    padding: 100rpx 40rpx 60rpx;
    background: #fafafa;

    .section-header {
      text-align: center;
      margin-bottom: 80rpx;

      .section-title {
        font-size: 48rpx;
        font-weight: bold;
        color: #1677ff;
        margin-bottom: 16rpx;
        display: block;
      }

      .section-subtitle {
        font-size: 28rpx;
        color: #666;
        display: block;
      }
    }

    .features-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(300rpx, 1fr));
      gap: 40rpx;
      max-width: 1200rpx;
      margin: 0 auto;

      .feature-card {
        background: #ffffff;
        border-radius: 16rpx;
        padding: 48rpx 32rpx;
        text-align: center;
        box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.08);
        transition: all 0.3s ease;
        border: 1rpx solid transparent;

        &:hover {
          transform: translateY(-8rpx);
          box-shadow: 0 12rpx 40rpx rgba(22, 119, 255, 0.15);
          border-color: rgba(22, 119, 255, 0.1);
        }

        .feature-icon {
          width: 80rpx;
          height: 80rpx;
          background: #f0f8ff;
          border-radius: 50%;
          display: flex;
          align-items: center;
          justify-content: center;
          margin: 0 auto 24rpx;
        }

        .feature-title {
          font-size: 32rpx;
          font-weight: 600;
          color: #333;
          margin-bottom: 12rpx;
          display: block;
        }

        .feature-desc {
          font-size: 26rpx;
          color: #666;
          line-height: 1.5;
          display: block;
        }
      }
    }
  }

  // 应用截图
  .screenshots-section {
    padding: 100rpx 40rpx 60rpx;
    background: #ffffff;

    .section-header {
      text-align: center;
      margin-bottom: 80rpx;

      .section-title {
        font-size: 48rpx;
        font-weight: bold;
        color: #1677ff;
        margin-bottom: 16rpx;
        display: block;
      }

      .section-subtitle {
        font-size: 28rpx;
        color: #666;
        display: block;
      }
    }

    .screenshots-container {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 40rpx;
      max-width: 1000rpx;
      margin: 0 auto;
      padding-bottom: 20rpx;

      .screenshot-item {
        .phone-mockup {
          padding: 24rpx;
          background: #f5f5f5;
          border-radius: 24rpx;
          text-align: center;
          border: 1rpx solid #e8e8e8;

          :deep(uni-image) {
            width: 100%;
            height: auto;
            img {
              width: 100%;
              border-radius: 16rpx;
            }
          }

          .screenshot-label {
            font-size: 24rpx;
            color: #666;
            margin-top: 16rpx;
            display: block;
          }
        }
      }
    }
  }

  // 下载区域
  .download-section {
    padding: 100rpx 40rpx;
    background: linear-gradient(135deg, #1677ff 0%, #40a9ff 100%);
    color: #ffffff;
    text-align: center;

    .download-content {
      max-width: 800rpx;
      margin: 0 auto;

      .download-title {
        font-size: 48rpx;
        font-weight: bold;
        margin-bottom: 16rpx;
        display: block;
      }

      .download-subtitle {
        font-size: 28rpx;
        opacity: 0.9;
        margin-bottom: 60rpx;
        display: block;
      }

      .download-buttons {
        display: flex;
        justify-content: center;
        gap: 32rpx;
        flex-wrap: wrap;

        .download-item {
          display: flex;
          align-items: center;
          gap: 16rpx;
          background: rgba(255, 255, 255, 0.15);
          border: 1rpx solid rgba(255, 255, 255, 0.3);
          border-radius: 12rpx;
          padding: 24rpx 32rpx;
          cursor: pointer;
          transition: all 0.3s ease;
          backdrop-filter: blur(10rpx);

          &:hover {
            background: rgba(255, 255, 255, 0.25);
            transform: translateY(-2rpx);
          }

          .download-text {
            .download-platform {
              font-size: 28rpx;
              font-weight: 600;
              display: block;
            }

            .download-desc {
              font-size: 22rpx;
              opacity: 0.8;
              display: block;
            }
          }
        }
      }
    }
  }

  // 底部
  .footer {
    background: #001529;
    color: #ffffff;
    padding: 80rpx 40rpx 40rpx;

    .footer-content {
      max-width: 1200rpx;
      margin: 0 auto;
      text-align: center;

      .footer-info {
        margin-bottom: 40rpx;

        .footer-title {
          font-size: 36rpx;
          font-weight: bold;
          margin-bottom: 12rpx;
          display: block;
        }

        .footer-desc {
          font-size: 26rpx;
          opacity: 0.8;
          display: block;
        }
      }

      .footer-links {
        display: flex;
        justify-content: center;
        gap: 40rpx;
        margin-bottom: 40rpx;
        flex-wrap: wrap;

        .footer-link {
          font-size: 26rpx;
          opacity: 0.8;
          cursor: pointer;
          transition: opacity 0.3s ease;

          &:hover {
            opacity: 1;
          }
        }
      }

      .copyright {
        font-size: 24rpx;
        opacity: 0.6;
        border-top: 1rpx solid rgba(255, 255, 255, 0.1);
        padding-top: 32rpx;
        display: block;
      }
    }
  }
}

// 响应式设计
@media screen and (max-width: 768rpx) {
  .home {
    .hero-banner .hero-content {
      flex-direction: column;
      text-align: center;

      .hero-image {
        margin-left: 0;
        margin-top: 40rpx;
      }
    }
    .header {
      .nav-container {
        max-width: 1200rpx;
      }
    }

    .features-section .features-grid {
      grid-template-columns: 1fr;
    }

    .screenshots-section .screenshots-container {
      justify-content: flex-start;
      grid-template-columns: 1fr;
    }

    .download-section .download-content .download-buttons {
      flex-direction: column;
      align-items: center;
    }

    .footer .footer-content .footer-links {
      flex-direction: column;
      gap: 20rpx;
    }
  }
}

@media screen and (min-width: 800px) {
  .home {
    .hero-banner {
      background: radial-gradient(
          50% 50%,
          rgba(34, 34, 34, 0.3) 0%,
          rgba(34, 34, 34, 0.7) 100%
        ),
        url("../../static/images/server-4.jpg") no-repeat center center;
      background-size: cover;
      height: 750px;
      .hero-content {
        max-width: 1200px !important;
        height: 100%;
        margin: 0 auto;
        justify-content: center;
        .hero-text {
          .hero-title {
            font-size: 48px;
            font-weight: bold;
            margin-bottom: 20px;
            display: block;
          }
          .hero-subtitle {
            font-size: 16px;
            line-height: 1.5;
            opacity: 0.9;
            margin-bottom: 60px;
            display: block;
          }
        }
        .hero-buttons {
          width: 450px !important;
          margin: 0 auto;
          .download-btn {
            width: 200px !important;
          }
          .learn-btn {
            width: 200px !important;
          }
        }
      }
    }
    .features-section {
      .features-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 80rpx;
        max-width: 1200px !important;
        margin: 0 auto;
        padding-bottom: 20rpx;
        .feature-card {
          padding: 80rpx 40rpx;
          .feature-icon {
            width: 120rpx;
            height: 120rpx;
          }
          .feature-title {
            font-size: 48rpx;
            font-weight: bold;
            margin-bottom: 24rpx;
            display: block;
          }
          .feature-desc {
            font-size: 28rpx;
            opacity: 0.8;
            display: block;
          }
          &:hover {
            transform: translateY(-8rpx);
            box-shadow: 0 12rpx 40rpx rgba(22, 119, 255, 0.15);
            border-color: rgba(22, 119, 255, 0.1);
          }
        }
      }
    }
    .screenshots-section {
      .screenshots-container {
        grid-template-columns: repeat(4, 1fr);
        gap: 80rpx;
        max-width: 1200px !important;
        margin: 0 auto;
        padding-bottom: 20rpx;
      }
    }
  }
}

// 动画效果
@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-20rpx);
  }
}

// 从下到上渐入动画
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translate3d(0, 60rpx, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

// 缩放渐入动画
@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

// 放大渐入动画
@keyframes zoomIn {
  from {
    opacity: 0;
    transform: scale(0.5);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

// 脉冲动画
@keyframes pulse {
  0% {
    box-shadow: 0 8rpx 24rpx rgba(22, 119, 255, 0.3);
  }
  50% {
    box-shadow: 0 8rpx 40rpx rgba(22, 119, 255, 0.6);
  }
  100% {
    box-shadow: 0 8rpx 24rpx rgba(22, 119, 255, 0.3);
  }
}

// 动画类
.animate-fade-in-up {
  animation: fadeInUp 0.8s ease-out forwards;
  opacity: 0;
}

.animate-scale-in {
  animation: scaleIn 0.6s ease-out forwards;
  opacity: 0;
}

.animate-zoom-in {
  animation: zoomIn 0.6s ease-out forwards;
  opacity: 0;
}

.pulse-animation {
  animation: pulse 2s ease-in-out infinite;
}

// 延迟类
.animate-delay-0 {
  animation-delay: 0.1s;
}

.animate-delay-1 {
  animation-delay: 0.2s;
}

.animate-delay-2 {
  animation-delay: 0.4s;
}

.animate-delay-3 {
  animation-delay: 0.3s;
}

.animate-delay-4 {
  animation-delay: 0.4s;
}

.animate-delay-5 {
  animation-delay: 0.5s;
}

// 为功能卡片图标添加旋转动画
.feature-card {
  .feature-icon {
    transition: transform 0.5s ease;
  }

  &:hover .feature-icon {
    transform: rotate(360deg);
  }
}

// 截图悬浮效果
.screenshot-item {
  .phone-mockup {
    transition: transform 0.3s ease;
  }

  &:hover .phone-mockup {
    transform: translateY(-12rpx);
  }
}
</style>
